#ifndef TASKLISTMODELUTIL_H
#define TASKLISTMODELUTIL_H

#include <QObject>
#include "../tasktop4qtcreator/tasklistroot.h"
#include "../tasktop4qtcreator/taskcontainer.h"
#include "ticketitemmodel.h"

//util class for converting the task list mode from and to the trac ticket model
class TasklistModelUtil : public QObject
{
    Q_OBJECT

public:
    static TaskListRoot* rootFromQuery(QString repoUrl, QString queryLabel);
    static TaskContainer* containerFromQuery(BaseTicketItemModel *model, QString repoUrl, QString queryLabel);
    static TaskListRoot* rootFromPreviousRoot(TaskListRoot *previousRoot, QString repoUrl, QString queryLabel);
    static QList<TaskContainer*> containersFromPreviousContainers(QList<TaskContainer*> previousContainers, BaseTicketItemModel *model, QString repoUrl, QString queryLabel);
    static TaskContainerHandle * containerHandleFromQuery(QString repoUrl, QString queryLabel);
private:
    TasklistModelUtil(QObject *parent = 0);
    static Repository * copyRepository(Repository *toCopy, QObject *parent = 0);
    static TaskContainerHandle * copyContainerHandle(TaskContainerHandle *toCopy, QObject *parent = 0);
    static TaskContainer * copyContainer(TaskContainer *toCopy, QObject *parent = 0);
    static TaskHandle * copyTaskHandle(TaskHandle *toCopy, QObject *parent = 0);
    static Person * copyPerson(Person *toCopy, QObject *parent = 0);

signals:

public slots:

};

#endif // TASKLISTMODELUTIL_H
